options(device="quartz")

## Check positivity!
load("w1.rda")
load("b1.rda")
load("w2.rda")
load("b2.rda")



points<-rev(c(h1W$point, h1B$point, h2W$point , h2B$point))
ses<-rev(c(h1W$se, h1B$se, h2W$se, h2B$se))


cis.hi<-points+1.96*ses
cis.lo<-points-1.96*ses

pdf("Fig3_Ratkovic.pdf",h=4*1.35,w=4*1.35)

par(mar = c(3, .2,1,0.2), # Dist' from plot to side of page
    mgp = c(2, 0.4, 0), # Dist' plot to label
    las = 1, # Rotate y-axis text
    tck = -.01, # Reduce tick length
    xaxs = "i", yaxs = "i", # Remove plot padding
    oma =c(0,0,0,0))

plot(0, xlim=range(c(-.285,.285)), ylim=c(1,3),xaxt="n",yaxt="n",xlab="",ylab="")



rect(par("usr")[1],par("usr")[3],par("usr")[2],par("usr")[4],col = "gray95")
abline(h=(1:100)/10,col="white")
abline(v=(-90:90)/20,col="white")

axis(1)

abline(v=0,lwd=5,col=gray(1))




ys.cis<-c(1.25,1.75, 2.25,2.75)

segments(y0=ys.cis, y1=ys.cis,x0=cis.lo,x1=cis.hi,lwd=3,
          col=gray(.3))

points(x=points,y=ys.cis,col=gray(.3),cex=1.5,pch=19)
text.use<-rev(c("Whites, < 1km from Demolished Projects", "Blacks, < 1km from Demolished Projects","Whites, > 1km from Any Projects","Blacks, > 1km from Any Projects"))

text(pos=3, x=points,y=ys.cis+.025,text.use, cex=.95)
mtext(side=1,"Estimated Causal Effect of Distance on Turnout",line=2,font=2)
dev.off()
